package com.szh.cloud.user.service;

import com.szh.cloud.mybatis.entity.PtUserEntity;
import com.szh.cloud.mybatis.flexigrid.FlexResEntity;
import com.szh.cloud.mybatis.flexigrid.PagingBean;
import com.szh.cloud.mybatis.ztree.ZtreeEntity;
import com.szh.cloud.user.entity.PasswordEntity;
import com.szh.cloud.user.entity.SearchUserEntity;
import com.szh.cloud.user.entity.UserEntity;
import com.szh.cloud.user.execption.RepeatEmailException;
import com.szh.cloud.user.execption.RepeatMobileException;
import com.szh.cloud.user.execption.RepeatUserNameException;
import com.szh.cloud.user.execption.UseNameCcupdException;

import java.util.List;

public interface UserService {
    /**
     * 查询所有用户信息
     * @param userName
     * @return
     */
    List<PtUserEntity> queryUserInfo(String userName);

    /**
     * 删除用户
     * @param userUuid
     */
    void deleteUserById(String userUuid);

    /**
     * 查询用户信息分页
     * @param entity
     * @param paging
     * @return
     */
    FlexResEntity<PtUserEntity> getUserInfoListByPage(SearchUserEntity entity, PagingBean paging);

    /**
     * 查询角色ztree
     * @param userUuids
     * @return
     */
    List<ZtreeEntity> getRoleByUserId(String userUuids);
    /**
     * 保存角色和用户对应关系
     * @param userUuids
     * @param roleIds
     */
    void saveRoleByUser(String userUuids, String roleIds);

    /**
     * 单用户查询角色ztree
     * @param userUuid
     * @return
     */
    List<ZtreeEntity> getRoleBySingUserId(String userUuid);

    void addUserInfo(UserEntity userEntity) throws RepeatUserNameException, RepeatEmailException, RepeatMobileException;

    /**
     * 根据用户编码查询用户列表
     * @param userUuid
     * @return
     */
    PtUserEntity queryUserListById(String userUuid);

    /**
     * 根据用户编码修改用户信处
     * @param userEntity
     */
    void modifyUserInfo(UserEntity userEntity) throws RepeatUserNameException, RepeatEmailException, RepeatMobileException;

    /**
     * 删除用户到回站
     * @param userUuids
     */
    void deleteUserRecycleById(String userUuids) throws UseNameCcupdException, UseNameCcupdException;

    /**
     * 根据用户ID修改密码
     * @param entity
     */
    void modifyPasswordById(PasswordEntity entity);
}
